<?php

class SP_Cache{
    
    function SP_Cache(){
        $this->config =& Loader::config();
        $engine = ucfirst($this->config['cache_engine']);
        include_once(SYSBASE.'Libraries/Cache/'.$engine.'.php');
        $enginename = 'Cache_'.$engine;
        $this->_cache = new $enginename($this->config['cache_policy']);
    }

    function set($id,$data,$policy = null){
        $this->_cache->set($id,$data,$policy);
    }
    function get($id){
        return $this->_cache->get($id);
    }
    function remove($id){
        $this->_cache->remove($id);
    }
}